extends ./main_temp

block panelHeading 
     <div class="row " style="padding:0px 20px">
    <div class="inline-block" >
    <button type="button" id="btn_add" class="btn btn-success">添加</button>
    </div>
    <div class="inline-block">
    <button type="button" class="btn btn-danger" id="btn_del_batch" >选中删除</button>
    </div>
    <form class="form-inline .input-sm pull-right" style="padding-top: 0px" method="post" action="/stuM.html">
    <div class="btn-group" id="dormlist">
    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"aria-haspopup="true" aria-expanded="false" name="dorm" id="dormbtn"> 全部宿舍楼 <span class="caret"></span>
    </button>
    </div>
    <div class="btn-group" id="stulist">
     <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"  aria-haspopup="true" aria-expanded="false" name="namebox"id="namebtn">姓名 <span class="caret"></span>
    </button>
    </div>
    <div class="form-group">
    <label for="exampleInputEmail2"></label>
    <input type="text" class="form-control" placeholder="姓名" name="name" value="#{searchArgs ? searchArgs.name:'' }">
    </div>
    <button type="button" class="btn btn-default" aria-label="Left Align" id="btn_search">
    <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
    </button>
    </form>
    </div>

include ./datatable
block panelBody
    -  let titles = ["<input name='cb_select_all' type='checkbox'>","序号", "名称", "简介","操作"];
    +datatable(titles)
         each item in dormlist ? dromlist : []
                tr 
                    td(class="text-center")!= `<input name='cb_select' type='checkbox' value=${item.id}>`
                    td(class="text-center")!=item.id
                    td(class="text-center")!=item.name 
                    td(class="text-center")!=item.introduction 
                    td(class="text-center")!=`<button data-href="/edit.html?id=${item.id}" class="btn_edit btn btn-sm btn-warning">编辑</button>  <button data-href="/del.do?id=${item.id}" class="btn btn-danger btn-sm btn_del" >删除</button>`
    +pagination(pager)
block append scripts
    script(src="/js/common.js")
    script(src="/js/stu/stuM.js")